package com.dh.leetcode.k2;

import org.junit.Assert;
import org.junit.Test;

public class _2315_count_asterisks {
    public int countAsterisks(String s) {
        int res = 0;
        int len = s.length();
        int stack = 0;
        for (int i = 0; i < len; i++) {
            char c = s.charAt(i);
            if (stack == 0 && c == '*') {
                res++;
            }
            if (c == '|') {
                if (stack == 0) {
                    stack += 1;
                } else {
                    stack = 0;
                }
            }
        }
        return res;
    }

    @Test
    public void countAsterisksTest() {
        Assert.assertEquals(2, countAsterisks("l|*e*et|c**o|*de|"));
        Assert.assertEquals(0, countAsterisks("iamprogrammer"));
        Assert.assertEquals(5, countAsterisks("\"yo|uar|e**|b|e***au|tifu|l"));
    }

    @Test
    public void test222() {
        for (int i = 0x4e00; i <= 0x9fff; i++) {
           String str = i.
        }
    }
}
